package com.manor.paradise.adapter

import android.widget.ImageView
import android.widget.TextView
import com.manor.common.utils.scaleDown
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.manor.paradise.R
import com.manor.paradise.bean.RecordSBean

/**
 * 米壳明细
 * @constructor
 */
class StartPointAdapter(layoutResId: Int, data: MutableList<RecordSBean>?)
    : BaseQuickAdapter<RecordSBean, BaseViewHolder>(layoutResId, data) {

    override fun convert(helper: BaseViewHolder, item: RecordSBean) {
        var im_istop = helper.getView<ImageView>(R.id.im_istop)
        var tv_context = helper.getView<TextView>(R.id.tv_context)
        if(item.payType==1){
            im_istop.setImageResource(R.mipmap.pic_aura_list_top)
            tv_context.text = "+"+ item.starPoint.scaleDown(4)

        }else{
            tv_context.text = "-"+ item.starPoint.scaleDown(4)
            im_istop.setImageResource(R.mipmap.pic_aura_list_btn)
        }
        var tv_name = helper.getView<TextView>(R.id.tv_name)
        tv_name.text = item.content
        var tv_time = helper.getView<TextView>(R.id.tv_time)
        tv_time.text = item.createTime

    }
}
